package com.app.ui;

import com.app.listviewtest7.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.animation.RotateAnimation;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;

public class MyListView extends ListView implements OnScrollListener {

	
	private static final String TAG = "MyListView";
	
	private static final int RELEASE_TO_REFRESH = 0;
	private static final int PULL_TO_REFRESH = 1;
	private static final int REFRESHING = 0;
	private static final int DONE = 0;
	private static final int LOADING = 0;
	
	private static final int RATIO = 3;
	
	private LayoutInflater inflater;
	
	private LinearLayout headView;
	
	private TextView tipsTextView;
	private TextView updateTextView;
	private ProgressBar progressBar;
	private ImageView imageView;
	
	private RotateAnimation animation;
	private RotateAnimation reverseAnimation;
	
	private boolean isRecored;
	
	private int headContentHeight;
	private int headContentWidth;
	
	private int startY;
	private int firstItemIndex;
	
	private int state;
	
	private boolean isBack;
	
	private boolean isRefreshable;
	
	public MyListView(Context context) {
		super(context);
	}
	
	public MyListView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}


	public MyListView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public void init(Context context){
		setCacheColorHint(getResources().getColor(R.color.transparent));
		
		inflater = LayoutInflater.from(context);
		headView = (LinearLayout)inflater.inflate(R.layout.head1, null);
		
	}

	@Override
	public void onScroll(AbsListView view, int firstVisibleItem,
			int visibleItemCount, int totalItemCount) {
		
	}

	@Override
	public void onScrollStateChanged(AbsListView view, int scrollState) {
		
	}
	
}
